<template>
  <!-- 人员操作 -->
  <h-modal class="event-modal" v-model="show" :title="'详情'" hidenOk>
    <a-descriptions title="" bordered :column="2">
      <a-descriptions-item label="姓名">
        {{ form.name }}
      </a-descriptions-item>
      <a-descriptions-item label="民族">
        {{ form.nation }}
      </a-descriptions-item>
      <a-descriptions-item label="照片">
        <img :src="form.image" alt="" style="max-width: 200px">
      </a-descriptions-item>
      <a-descriptions-item label="出生日期">
        {{ form.birthday }}
      </a-descriptions-item>
      <a-descriptions-item label="政治面貌">
        {{ form.politicsStatus }}
      </a-descriptions-item>
      <a-descriptions-item label="性别">
        {{ form.gender == 0 ? '男' : '女' }}
      </a-descriptions-item>
      <a-descriptions-item label="最高学历">
        {{ form.highestEducation }}
      </a-descriptions-item>
      <a-descriptions-item label="专家定位">
        {{ form.orientation }}
      </a-descriptions-item>
      <a-descriptions-item label="毕业时间">
        {{ form.time }}
      </a-descriptions-item>
      <a-descriptions-item label="毕业院校及专业">
        {{ form.graduatedFrom }}
      </a-descriptions-item>
      <a-descriptions-item label="工作单位">
        {{ form.company }}
      </a-descriptions-item>
      <a-descriptions-item label="单位性质">
        {{ form.natureBusiness }}
      </a-descriptions-item>

      <a-descriptions-item label="身份证号">
        {{ form.idNumber }}
      </a-descriptions-item>
      <a-descriptions-item label="职称">
        {{ form.title }}
      </a-descriptions-item>
      <a-descriptions-item label="职务">
        {{ form.post }}
      </a-descriptions-item>
      <a-descriptions-item label="聘任时间">
        {{ form.engageTime }}
      </a-descriptions-item>
      <a-descriptions-item label="手机">
        {{ form.phone }}
      </a-descriptions-item>
      <a-descriptions-item label="区县市">
        {{ form.address }}
      </a-descriptions-item>
      <a-descriptions-item label="电子邮箱">
        {{ form.mail }}
      </a-descriptions-item>
      <a-descriptions-item label="通讯地址">
        {{ form.mailingAddress }}
      </a-descriptions-item>
      <a-descriptions-item label="研究领域">
        {{ form.researchField }}
      </a-descriptions-item>
      <a-descriptions-item label="类型">
        {{ tyleList[form.type] }}
      </a-descriptions-item>
      <a-descriptions-item label="工作简历">
        {{ form.jobResume }}
      </a-descriptions-item>
      <a-descriptions-item label="专业特长">
        {{ form.professionalExpertise }}
      </a-descriptions-item>
    </a-descriptions>
  </h-modal>
</template>

<script>
import moment from 'moment';
// eslint-disable-next-line
import { getEnforcementDetail } from '@/api/db';

export default {
  props: {
    id: {
      type: [Number, String],
      default: ''
    },
    showModal: {
      type: Boolean,
      default: false
    }
  },
  model: {
    prop: 'showModal',
    event: 'update:showModal'
  },
  watch: {
    showModal: {
      handler(val) {
        this.show = val;
        if (val) {
          this.detail();
          // detailAccount().then(res => {
          //   this.form = res.data || {};
          //   this.$set(this.form, 'isLayered', !!this.form.isLayered);
          // });
        }
      },
      immediate: true
    },
    show(val) {
      this.$emit('update:showModal', val);
    }
  },
  data() {
    return {
      moment,
      show: false,
      tyleList: {
        0: '网络专家',
        1: '司法专家',
        2: '行政专家'
      },
      form: {},
      type: 'add',
      rules: {
        possession: [{ required: true, message: '请选择' }],
        companyName: [{ required: true, message: '请输入' }],
        platform: [{ required: true, message: '请输入' }],
        link: [{ required: true, message: '请输入' }]
      },
      addressArr: []
    };
  },
  methods: {
    detail() {
      getEnforcementDetail({
        id: this.id
      }).then(res => {
        this.form = res.data;
      });
    }
  }
};
</script>

<style>

</style>
